package net.monare.mifss.lib.validators;

import net.monare.mifss.configurations.pojo.StorageSetDef;
import net.monare.mifss.exceptions.ConfigurationHandlerException;
import net.monare.mifss.exceptions.ValidatorException;

import java.util.List;

/**
 * Created by kristan_uros on 9.4.2014.
 */
public class StorageSetDefValidator  extends  BaseValidator{



    public void validateStorageSet(StorageSetDef storageSetDef ) throws ValidatorException {


        if(storageSetDef==null){
            String errMessage = "StorageSet should not be NULL";
            logger.error(errMessage);
            throw new ValidatorException(errMessage);
        }
        if(!isAlphaNumeric(storageSetDef.getName())){
            String errMessage = "StorageSet should have alphaNumeric name. Pattern: "+alphaNumericPattern;
            logger.error(errMessage);
            throw new ValidatorException(errMessage);
        }



    }

}
